#include <QDebug>
#include <QPushButton>
#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton* btn = new QPushButton(this);
    btn->move(300, 200);

//    connect(btn, &QPushButton::clicked, this, [btn, this]()
//    {
//        btn->move(200, 300);
//        this->move(200, 300);
//        qDebug() << "lambda执行";
//    });

    connect(btn, &QPushButton::clicked, this, [=]()->int
    {
        btn->move(200, 300);
        this->move(200, 300);
        qDebug() << "lambda执行";
    });
}

Widget::~Widget()
{
    delete ui;
}

